"""
    这里生成测试数据集
"""

import numpy as np
import csv

# 设计一个函数生成大量的无序序列数据
def generatorData(x):
    origin_array = np.random.randint(0, 20000, x).tolist()  # 生成x个随机数，创建一个列表

    return origin_array

# 生成数据集
test_list_disorder = []  # 无序数据集合
test_list_order = []  # 顺序数据集合
test_list_reserveorder = []

# 数据规模
test_n = [500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 1800]

for data_size in test_n:
    test_list_disorder.append(generatorData(data_size))  # 生成无序序列
    test_list_order.append([i for i in np.arange(0, data_size)])
    test_list_reserveorder.append([i for i in np.arange(data_size-1, -1, -1)])

"""步骤：
       1.创建数据和表头
       2.创建writer对象
       3.写表头
       4.在writerows里传入你要处理的数据
"""

# 写入csv文件中
with open('./experiment_first/testListDisOrder.csv', 'w', encoding='utf-8', newline='') as f:
    writer = csv.writer(f)
    writer.writerows(test_list_disorder)

with open('./experiment_first/testListOrder.csv', 'w', encoding='utf-8', newline='') as f:
    writer = csv.writer(f)
    writer.writerows(test_list_order)

with open('./experiment_first/testListReserveOrder.csv', 'w', encoding='utf-8', newline='') as f:
    writer = csv.writer(f)
    writer.writerows(test_list_reserveorder)